![]() |
DrawThemeFocusRect |
||||
Header: | Appearance.h | Carbon status: | Supported | |
Draws or erases a focus ring around a specified rectangle.
OSStatus DrawThemeFocusRect ( const Rect *inRect, Boolean inHasFocus );
A pointer to a structure of type Rect. Before calling DrawThemeFocusRect, set the rectangle to the position around which to draw the focus ring, in local coordinates. The focus ring is drawn outside the rectangle that is passed in, and it can be outset a maximum of 3 pixels.
A value of type Boolean. Pass true to draw the focus ring. Pass false to erase the focus ring.
A result code.
Your application can use the DrawThemeFocusRect function to draw a theme-compliant focus ring. The presence of a focus ring indicates whether an item has keyboard focus.
If you are drawing a focus ring around an element for which you have drawn a frame using DrawThemeEditTextFrame or DrawThemeListBoxFrame, you must coordinate your drawing sequence to achieve the correct look. When drawing the element, your application should first call DrawThemeEditTextFrame or DrawThemeListBoxFrame and then call DrawThemeFocusRect, passing the same rectangle in the inRect parameter. If you use DrawThemeFocusRect to erase the focus ring around an editable text frame or list box frame, you must redraw the editable text frame or list box frame after calling DrawThemeFocusRect, because there is typically an overlap.
This function is available with Appearance Manager 1.0 and later.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)